// 设计删除按钮样式

// 关闭VSCode非必要报错
// ignore_for_file: camel_case_types, must_be_immutable

import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

class MyYaruButton_Delete extends StatelessWidget {
  // 设置需要传入的变量/函数
  final String text;
  VoidCallback onPressed;
  MyYaruButton_Delete({
    super.key,
    required this.text,
    required this.onPressed,
  });

  @override
  Widget build(BuildContext context) {
    return YaruOptionButton(
      autofocus: false,
      onPressed: onPressed,    // 设置按下时触发的函数   
      style: ButtonStyle(
        backgroundColor:WidgetStatePropertyAll(YaruColors.adwaitaRed),     // 设置按钮背景颜色
      ),
      child: Text(
        text,
        style: TextStyle(
          color: YaruColors.porcelain,
          fontSize: 18,
        ),
      ),
    );
  }
}
